package com.demo02;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Test1{

    @Test
    public void test1(){
        ApplicationContext ac=
                new ClassPathXmlApplicationContext("beans.xml");
       Demo demo=(Demo)ac.getBean("demo");
        System.out.println(demo);
        ((ClassPathXmlApplicationContext)ac).close();
    }
}
